<?php
class TeacherCourseModel extends Model{
	protected $table='kq_teacher_course';
	protected $pk='id';
	//表中的字段
	protected $fields=array('role_id','id','class','course');

	public function deleteCourse($role_id){
		$sql = "delete from ".$this->table." where role_id=$role_id";
		if($this->db->query($sql)){
    		return $this->db->affected_rows();
    	}else{
    		return false;
    	}
	}
    
    /*
    *获取当前教师所教班级的课程
    **/
	public function getCourse($role_id,$class){
		$sql = "select course,cno from ".$this->table." where role_id='".$role_id."' and class='".$class."'";
		return $this->db->getAll($sql);
	}

}
?>